package day33;
import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            String[] str3 = str.split(" ");
            String str1 = str3[0];
            String str2 = str3[1];
            if(str1.length() < str2.length()) {
                return;
            }
            Queue<Character> queue = new LinkedList<>();
            for(int i = 0; i < str1.length(); i++) {
                queue.offer(str1.charAt(i));
            }
            boolean flg = false;
            Long count = 0l;
            while(!queue.isEmpty()) {
                if(queue.peek() == str2.charAt(0)){
                    flg = true;
                    queue.poll();
                    for(int i = 1; i < str2.length() && !queue.isEmpty(); i++) {
                        if(queue.peek() == str2.charAt(i)){
                            queue.poll();
                        }else {
                            flg = false;
                            break;
                        }
                    }
                    if(flg) {
                        count++;
                    }
                }else {
                    queue.poll();
                }

            }
            System.out.println(count);
        }
    }


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String s = in.next();
            String t = in.next();

            int count = cut(s,t);
            System.out.println(count);
        }
    }
    private static int cut(String s, String t) {
        int i = s.indexOf(t);
        if(i == -1) {
            return 0;
        }
        return 1 + cut(s.substring(i + t.length()),t);
    }


    public static void main2(String[] args) {
        long[] fib = new long[80];
        fib[0] = 1;
        fib[1] = 1;
        for(int i = 2; i < 80; i++) {
            fib[i] = fib[i-1] + fib[i-2];
        }
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int from = in.nextInt();
            int to = in.nextInt();
            long sum = 0l;
            for(int i = from-1; i < to; i++) {
                sum += fib[i];
            }
            System.out.println(sum);
        }
    }
}